A cache buffer is a high speed memory buffer inserted between a host system and a storage device, such as a disk drive, to store those portions of the disk drive data currently in use by the host. Since the cache is several times faster than the disk drive, it can reduce the effective disk drive access time. A typical disk drive includes a data disk having a plurality of concentric data tracks thereon, a spindle motor for rotating the data disk, and a transducer supported by an actuator controlled carrier for positioning the transducer over the data tracks.
A firmware cache manager controls transfer of data from the disk drive into the cache buffer, and manages the data stored in the cache buffer. A typical cache manager utilizes a cache directory containing data block memory addresses, and control bits for cache management and access control. The cache manager searches the cache directory to fetch and store data blocks in the cache buffer, and uses a replacement strategy to determine which data blocks to retain in the cache buffer and which to discard.
In response to a data read request from a host, the cache manager directs the actuator to position the transducer over a selected data track containing the requested data. However, reading data is delayed until the portion of the selected track containing the requested data rotates under the transducer. This delay degrades cache performance and increases data transfer response time.
In order to increase the hit ratio in the cache buffer, typical cache managers utilize a read-ahead strategy in retrieving the requested data from the selected track. The cache manger defines a data segment on the selected track, including a fetch area containing the requested data followed by a post-fetch data area. The cache manager first reads the requested data from the fetch area and then continues reading ahead to the end of the post-fetch area unless interrupted by another data transfer request.
To store the retrieved data into the cache buffer, the cache manager allocates and trims a cache segment in the cache buffer, comparable in size to that of data segment on the selected track. However, in doing so, the cache manager effectively discards all data in the allocated cache segment before reading any data from the selected track. Such an allocation and trimming method drastically reduces the hit ratio of the cache system and results in performance degradation. Since reading data from the post-fetch data area of the data segment must be interrupted to service any subsequent data transfer request, in many instances, only a portion of the data in the post-fetch area is retrieved and stored in a corresponding portion of the cache segment. As such, only a portion of the data in the cache segment is actually overwritten, and the pre-existing data in the remaining portion of the cache segment need not have been discarded. Any future reference to the pre-existing data results in a cache miss, requiring the cache manager to access the disk and retrieve that data again. However, disk access delays severely degrade the performance of the cache system and result in general degradation of the host performance.
There is, therefore, a need for a method of data transfer in a cache system which increases the cache hit ratio without degrading the cache performance due to disk access delays.